<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>优标检测网</title>
    <!-- 浏览器上显示title 图标 icon图标 -->
	<link type="image/x-icon" rel="icon" href="<%=basePath %>resource/img/minilogo.png">

	<!-- 如果想让图标出现在收藏夹中，就：  -->
	<link type="image/x-icon" rel="shortcut icon" href="<%=basePath %>resource/img/minilogo.png">
	<link type="image/x-icon" rel="bookmark" href="<%=basePath %>resource/img/minilogo.png">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="优标">
	<meta http-equiv="description" content="优标">
    <link href="<%=basePath %>portal/css/main.css" type="text/css" rel="stylesheet">
    <link href="<%=basePath %>portal/css/datepickerbootstrap.css" type="text/css" rel="stylesheet">
    <title>上传标准</title>
    <style type="text/css">
    .PCFileUploadBox1{position:relative}
    </style>
</head>
<body>
<%@include file="p_head.jsp"%>
<div class="NCContent">
    <div class="NCNewsHead">
        <div class="MainPage">
            <div class="NCMain">
                <h2 class="NCHeadWord">质量控制 / Quality Control</h2>
            </div>
        </div>
    </div>
    <div class="NCNewsList">
        <div class="MainPage">
            <div class="NCMain">
                <div class="NCNewsListContent">
                	<form action="<%=basePath%>report_doUpload.action" method="post" id="reportForm" enctype="multipart/form-data">
                	<input type="hidden" id="compId" name="compId" value="${compId}"/>
                    <div class="QCTitleContentHead">上传企业监测报告</div>
                    <div class="PCFileUploadBody">
                        <div class="PCFileUploadTabBtn">
                            <a class="PCFileUploadBtn1"></a>
                            <a class="PCFileUploadBtn2" href="<%=basePath %>report_showMultiUpload.action"></a>
                        </div>
                        <div class="PCFileUpLoadSimple">
                            <div class="PCFileUploadBox1">
                                <span class="PCFileUploadTitle1">企业名称</span>
                                <span class="PCFileUploadContent"><input class="PCFUCText1" type="text" id="compName" name="compName"/>
                                <span style="display:none" class="RegMsg">*企业名称不能为空</span>
								</span>
                            </div>
                            <div class="PCFileUploadBox1">
                                <span class="PCFileUploadTitle1">报告编号</span>
                                <span class="PCFileUploadContent"><input class="PCFUCText1" type="text" id="reportNumber" name="reportNumber"/>
								<span style="display:none" class="RegMsg">*报告编号不能为空</span></span>
                            </div>
                            <div class="PCFileUploadBox1">
                                <span class="PCFileUploadTitle1">样品名称</span>
                                <span class="PCFileUploadContent"><input class="PCFUCText1" type="text" id="sampleName" name="sampleName"/>
                                <span style="display:none" class="RegMsg">*样品名称不能为空</span></span>
                            </div>
                            <div class="PCFileUploadBox1">
                                <span class="PCFileUploadTitle1">生产日期批号</span>
                                <span class="PCFileUploadContent"><input class="PCFUCText1" type="text" id="scrqph" name="scrqph"/>
                                <span style="display:none" class="RegMsg">*生产日期批号不能为空</span></span>
                            </div>
                            <div class="PCFileUploadBox1">
                                <span class="PCFileUploadTitle1">上传附件</span>
                                <span class="PCFileUploadContent"><input type="file" id="report" name="report"/>
                                <span style="display:none" class="RegMsg">*上传附件不能为空</span></span>
                            </div>
                        </div>
                        <span class="BtnCss PCFileUploadBtn">上传</span>
                        <div style="padding-bottom:70px;"></div>
                        <div style="clear:both"></div>
                    </div>
                    <div class="NCNewsListContentFoot"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" name="basePath" id="basePath" value="<%=basePath%>"/>
<%@include file="p_foot.jsp"%>
</body>
<script src="<%=basePath %>portal/js/res/jquery-1.4.2.min.js"></script>
<script src="<%=basePath %>portal/js/res/responsiveslides.min.js"></script>
<script src="<%=basePath %>portal/js/res/zebra_datepicker.src.js"></script>
<script src="<%=basePath %>portal/js/page/base.js"></script>
<script src="<%=basePath %>portal/js/page/report.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<script>
$('#reportForm').form({
    onSubmit: function() {
        return $(this).form('validate');
    },
    success: function(data) {
		var mydata = JSON.parse(data);
		switch(mydata.result) {
		case 0:
			window.location="<%=basePath%>report_index.action";
			break;
		case 1:
		case 2:
			$("#compName").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 3:
			$("#reportNumber").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 4:
			$("#sampleName").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 5:
			$("#scrqph").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 6:
		case 7:
		case 8:
		case 9:
		case 10:
			$("#report").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		}
	}
});
$(".PCFileUploadBtn").click(function(){
	var flag = true;
    flag = checkReportNumber();
    flag = checkSampleName();
	flag = checkScrqph();
	flag = checkReport();
    
	if (flag)
		$('#reportForm').submit();
});
</script>
</html>